package cn.net.qinling.healthcare.test.datagen;

import java.util.List;

import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory;
import org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation;
import org.openhealthtools.mdht.uml.hl7.datatypes.CD;
import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory;
import org.openhealthtools.mdht.uml.hl7.vocab.ActClassObservation;
import org.openhealthtools.mdht.uml.hl7.vocab.x_ActMoodDocumentObservation;

import cn.net.qinling.healthcare.CDARootIdentifiers;

public class ProblemGenerator extends Generator<ProblemObservation> {

	public ProblemGenerator(Selector selector) {
		super(selector);
	}

	@Override
	protected ProblemObservation doGeneration() {
		ProblemObservation po = CCDFactory.eINSTANCE.createProblemObservation();
		CD code = DatatypesFactory.eINSTANCE.createCD();
		
		List<String> list = selector.next(CDARootIdentifiers.ICD10);
		
		code.setCodeSystem(CDARootIdentifiers.ICD10);
		code.setCodeSystemName("ICD-10");
		code.setCode(list.get(0));
		code.setDisplayName(list.get(1));
		
		po.setClassCode(ActClassObservation.OBS);
		po.setMoodCode(x_ActMoodDocumentObservation.EVN);
		po.setCode(code);
		
		return po;
	}
	
	
	
	

}
